<!DOCTYPE html>



<html>



<head>



    <title>会员详情</title>



    <include file='public/head'>



	<style>



		.layui-legend-size{font-size:14px !important;}



		.layui-nopadding{padding:0 !important;}



		.layui-overflow{overflow:auto;}



		.layui-nomargin{margin: 0 !important;}



		.layui-bottom{border-bottom:1px solid rgb(226, 226, 226);}



		.layui-input{height:30px !important; }



		.layui-form-search-item .layui-inline{margin-bottom: 5px;} 



		.layui-form-search-item label{margin-left: 15px;}



		.layui-table-page {padding: 7px 0px 0px;}



		.layui-field-padding{border-width: 1px;padding:0 0 5px 10px;}



		th{

			/*background-color: #E8E8E8;*/

			/*text-align:right;*/

		}



	</style>

</head>



<body>



<div class="layui-fluid">

	<form class="layui-form" id="f">

			<!-- {$detailStr} -->

	</form>

</div>



<div class="layui-tab " lay-filter="demo-tab">



	<div class="layui-tab-nav" >

        <ul class="layui-tab-title">

			<!-- {:getNav('member','admin_index/index')}; -->

			<li style="padding: 0;" class="layui-this" onclick="history.go(-1)">

				<a style="padding:0 15px;">

					返回

				</a>

			</li>

		</ul>

	</div>



	<!-- 表格内容开始 -->

	<div class="layui-card">

		<div class="layui-card-body layui-nopadding">

			<!-- <fieldset class="layui-elem-field layui-field-title layui-field-padding"> -->

				<!-- <legend class="layui-legend-size">店铺信息</legend> -->

				<table style="width: 100%">

					<tr>

						<td rowspan="4" width="20%">

							<center>

								<div onclick="show_img(this)">

									<img style="max-width: 100px;" src="{$zy_domain|default=''}{$list['head_portrait']|default=''}">

								</div>

							</center>

						</td>

						<td width="10%">昵称:</td>

						<td>{$list['nick_name']|default=''}</td>

						<td width="10%">UID:</td>

						<td>{$list['uid']|default=''}</td>



						<if condition="!empty($store)">

							<td width="10%">

								所属店铺：

							</td>

							<td>

								

							</td>

						</if>



					</tr>

					<tr>

						<td>注册时间</td>

						<td>

							<php>

								echo date('Y-m-d H:i:s',$list['join_date']);

							</php>

						</td>

						<td>

							<if condition="$list['status'] == 1">

								<button class="layui-btn layui-btn-danger forbidden-btn" data-id='{$list.id}'>禁用账号</button>

							</if>

							<if condition="$list['status'] == 2">

								<button class="layui-btn layui-btn-normal startusing-btn" data-id='{$list.id}'>启用账号</button>

							</if>							

						</td>

					</tr>

					<tr>

						<td colspan="4"><hr></td>

					</tr>

					<tr>

						<td class="" colspan="2">

							<button class="layui-btn">发送站内信</button>

							<button class="layui-btn">发送优惠券</button>

						</td>

					</tr>

				</table>

				<br>

			<!-- </fieldset> -->

		</div>

	</div>



	<div class="layui-card">

		<div class="layui-card-body layui-nopadding " >

			<fieldset class="layui-elem-field layui-field-title layui-field-padding">

				<legend class="layui-legend-size">主要信息</legend>

				{$detailStr}

			</fieldset>

		</div>

	</div>		

	<div class="layui-card">

		<div class="layui-card-body layui-nopadding " >

			<fieldset class="layui-elem-field layui-field-title layui-field-padding">

				<legend class="layui-legend-size">财产资产</legend>

				<table  class="layui-table layui-nomargin" >
					<tr>
						<td width="25%"><b>账户余额</b></td>
						<td width="25%">{$balance|default=0}</td>
						<td width="25%"><b>消费金额</b></td>
						<td width="25%">{$order_sum|default=0}</td>
					</tr>
					<tr>
						<td><b>消费次数</b></td>
						<td>{$order_count|default=0}</td>
						<td><b>订单均价</b></td>
						<td>{$order_average|default=0}</td>
					</tr>
					<tr>
						<td><b>当前积分</b></td>
						<td>{$market['integral']}</td>
						<td><b>累计积分</b></td>
						<td>{$market['total_integral']}</td>
					</tr>
					<tr>
						<td><b>未使用优惠券</b></td>
						<td>{$market['notused']}</td>
						<td><b>已使用优惠券</b></td>
						<td>{$market['used']}</td>
					</tr>
					<tr>
						<td><b>已过期优惠券</b></td>
						<td>{$market['expired']}</td>
						<td></td>
						<td></td>
					</tr>																				
				</table>

			</fieldset>

		</div>

	</div>	



</div>



	<include file='public/scripts'>



</body>



<script type="text/javascript">

	

	//禁用

	$('.forbidden-btn').on('click',function(){

		var  text = "确定要禁用吗？";

		let id = $(this).data('id');

		let url = "{:cmf_plugin_url('Member://admin_index/forbidden')}";

		layer.confirm(text, {icon: 3, title:'提示', btn: ['确定','取消']}, function(index,layero){

	        $.ajax({

	        	type:'post',

	            url:url,

	            data:{id:id},

	            success:function(data){

					if (data.code == 1) {

						layer.msg(data.msg,{icon:1,time:1500},function(){

							parent.layer.closeAll();

							parent.location.reload(); 

						});

					} else {

						layer.msg(data.msg,{icon:2,time:1500});

					}

	            },

	            error:function(){

	                layer.msg('系统错误',{icon:2,time:1500});

	            }

	        })

	    },function(index){

	        // alert('取消');

	    });		

	});

	

	//启用

	$('.startusing-btn').on('click',function(){

		var  text = "确定要启用吗？";

		let id = $(this).data('id');

		let url = "{:cmf_plugin_url('Member://admin_index/startusing')}";

		layer.confirm(text, {icon: 3, title:'提示', btn: ['确定','取消']}, function(index,layero){

	        $.ajax({

	        	type:'post',

	            url:url,

	            data:{id:id},

	            success:function(data){

					if (data.code == 1) {

						layer.msg(data.msg,{icon:1,time:1500},function(){

							parent.layer.closeAll();

							parent.location.reload(); 

						});

					} else {

						layer.msg(data.msg,{icon:2,time:1500});

					}

	            },

	            error:function(){

	                layer.msg('系统错误',{icon:2,time:1500});

	            }

	        })

	    },function(index){

	        // alert('取消');

	    });		

	});	



	//显示大图片

	function show_img(t) {

	    var t = $(t).find("img");

	    //页面层

	    layer.open({

	    	title:false,

	        type: 1,

	        skin: 'layui-layer-rim', //加上边框

	        area: ['auto','auto'],

	         // area: ['80%', '80%'], //宽高

	         scrollbar: false,

	        shadeClose: true, //开启遮罩关闭

	        end: function (index, layero) {

	            return false;

	        },

	        content: '<div style="text-align:center"><img src="' + $(t).attr('src') + '" /></div>'

	    });

	}	



</script>



</html>